package be.novelfaces.showcase.webdriver.pages.numpaddecsep;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;

import be.novelfaces.component.webdriver.NumpadDecSep;
import be.novelfaces.component.webdriver.SourcePanel;
import be.novelfaces.showcase.webdriver.util.NFBy;
import be.novelfaces.webdriver.component.primefaces.TabContent;

public class Example1TabContent extends TabContent {

	@FindBy(id = NFBy.MAIN_FORM + "locale")
	private WebElement select;
	private NumpadDecSep localeDecSep;
	private SourcePanel xhtmlPanel;
	private SourcePanel beanPanel;

	public void setValueOfLocaleSelect(String value) {
		new Select(select).selectByValue(value);
		waitForAjaxToComplete();
	}

	public NumpadDecSep getLocaleDecSep() {
		return localeDecSep;
	}
	
	public SourcePanel getXhtmlPanel() {
		return xhtmlPanel;
	}
	
	public SourcePanel getBeanPanel() {
		return beanPanel;
	}

	@Override
	public void init() {
		localeDecSep = new NumpadDecSep(NFBy.mainFormId("localeDecSep"),
				NFBy.mainFormId("localeInput"));
		xhtmlPanel = new SourcePanel(NFBy.MAIN_FORM +"example1XhtmlPanel");
		beanPanel = new SourcePanel(NFBy.MAIN_FORM +"example1BeanPanel");
	}
}
